how to create api endpoints with node